<template>
  <div v-if="isShow">
    <section class="dialog">
      <div class="content">
        <span class="title">{{ title }}</span>
        <div class="desc">{{ desc }}</div>
        <button class="primary" @click="$emit('click', $event)">确认</button>
      </div>
    </section>
  </div>
</template>

<script>
export default {
  name: 'myDialog',
  props: ['isShow', 'title', 'desc']
}
</script>

<style lang="less" scoped>
// dialog
.dialog {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .5);
  .content {
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    width: 320px;
    height: 192px;
    border-radius: 3px;
    background-color: #fff;
    .title {
      font-size: 18px;
      color: #262626;
      font-weight: 500;
    }
    .desc {
      min-height: 50px;
      padding: 26px 0 12px;
      font-size: 16px;
      line-height: 22px;
      color: #595959;
    }
    .primary {
      position: absolute;
      right: 20px;
      bottom: 20px;
      min-width: 64px;
      font-size: 14px;
      height: 40px;
      box-sizing: border-box;
      line-height: 38px;
      border-radius: 2px;
      color: #fff;
      text-align: center;
      text-decoration: none;
      border: none;
      background: #0095FF;
      outline: none;
      cursor: pointer;
    }
  }
}
</style>